home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / TwinOpus2 / REXX / DOpus / MakeDir.rexx < prev    next >
OS/2 REXX Batch file  |  1994-10-13  |  2KB  |  77 lines

  1. /*
  2.  *
  3.  * Makes a directory with TwinExpres from DOpus.
  4.  *
  5.  * (c) 1994 by K.P. van Beem (2:280/464.2, patrick.van.beem@aobh.xs4all.nl)
  6.  *
  7.  * Based on the DOpusLhaARexx package by Geoff Seeley (but you can better
  8.  * use GuiArc in stead of DOpus and a script, to deal with archives)
  9.  *
  10.  */
  11.  
  12. DOpusPort   = 'DOPUS.1'
  13.  
  14. if ~show(l,"rexxsupport.library") then        
  15.     call addlib("rexxsupport.library",0,-30,0)
  16. if showlist('Ports', DOpusPort) = 0 then do
  17.    say 'Directory Opus Arexx port not found. Aborting.'
  18.    call CleanUp
  19. end
  20.  
  21. address 'DOPUS.1'
  22. options results
  23.  
  24. /* setup DOpus window and tell user what's happening */
  25. Busy on
  26. TopText "Creating (sub)directory..."
  27.  
  28. /* Get the current path to create the dir */
  29. 'Status 6 -1'
  30. GetEntry Result
  31. FilePath = Result
  32. if left(FilePath,1) != '*' then do
  33.    TopText "You are not in a Twin directory."
  34.    call CleanUp
  35. end
  36.  
  37. /* Get the name of the directory to create */
  38. getstring  '"Enter Directory Name"'
  39. Directory = Result
  40. if Directory="" | rc~=0 then do
  41.    TopText "You have to specify a directory."
  42.    call CleanUp
  43. end
  44.  
  45. if right(FilePath,1) = ':' then
  46.    FilePath = FilePath || Directory
  47. else
  48.    FilePath = FilePath || '/' || Directory
  49. address command 'echo >PPipe: MkDir' Quote(FilePath)
  50.  
  51.  
  52. TopText "Ready"
  53. 'DisplayDir -1'
  54. address AREXX "Rexx:DOpus/Reread.rexx"
  55. call CleanUp
  56.  
  57. exit
  58.  
  59. /*---------------------------------------------------------------------------*/
  60.  
  61. CleanUp: /* Remove any files and exit */
  62.  
  63.    Busy off
  64.  
  65.    exit
  66.  
  67. return
  68.  
  69. /*--------------------------------------------------------------------------*/
  70.  
  71. Quote: procedure /* add quotes to string */
  72.  
  73.    parse arg string
  74.  
  75. return '"'||string||'"'
  76.  
  77.